﻿using System;

namespace NeurOthello.Logic
{
    public class AiMove : Position, IComparable
    {
        private double value;
        public double Value { get { return value; } }

        public AiMove(Position move, double value)
            : base(move.X, move.Y)
        {
            this.value = value;
        }

        public override string ToString()
        {
            return string.Format("{0} value: {1:0}", base.ToString(), value); //"(" + base.ToString() + " value: " + value + ")";
        }

        
        public int CompareTo(object obj)
        {
            AiMove other = obj as AiMove;
            if (other != null)
                //negativ eftersom vi vill ha fallande ordning efter sortering.
                return -this.value.CompareTo(other.value);
            else
                throw new ArgumentException("Object is not an AiMove");
        }
    }
}